import http from '@/http/index.ts'
import { DeviceElectricalMachineryQuery, DeviceElectricalMachinery } from './type'

// 获取电机数据列表（分页）
export const getDeviceElectricalMachineryList = (params: DeviceElectricalMachineryQuery) => {
  return http.get('/api/device-electrical-machinery/page', params)
}

// 获取电机数据详情
export const getDeviceElectricalMachineryDetail = (id: number) => {
  return http.get(`/api/device-electrical-machinery/${id}`)
}

// 新增电机数据
export const addDeviceElectricalMachinery = (data: DeviceElectricalMachinery) => {
  return http.post('/api/device-electrical-machinery', data)
}

// 更新电机数据
export const updateDeviceElectricalMachinery = (data: DeviceElectricalMachinery) => {
  return http.put('/api/device-electrical-machinery', data)
}

// 删除电机数据
export const deleteDeviceElectricalMachinery = (id: number) => {
  return http.delete(`/api/device-electrical-machinery/${id}`)
} 